package tank;

import java.awt.Graphics;

import abstractBeanFactory.BaseExplode;

public class Explode extends BaseExplode{
	public static final int WIDTH = ResourceMgr.explodes[0].getWidth();
	public static final int HEIGHT = ResourceMgr.explodes[0].getWidth();
	private static final int SPEED =5;
	private int x,y;
	private TankFrame tf = null;
	private boolean living = true;
	private int step =0;
	public Explode(int x, int y, TankFrame tf) {
		super();
		this.x = x;
		this.y = y;
		this.tf = tf;
		new Thread(()->new Audio("audio/explode.wav").play()).start();
	}
	public void paint(Graphics g) {
		g.drawImage(ResourceMgr.explodes[step++], x, y, null);
		if(step>=ResourceMgr.explodes.length) {
			tf.explodes.remove(this);
		}
	}
	
	
}
